package com.yq.cns

import android.os.Bundle
import androidx.activity.compose.setContent
import androidx.appcompat.app.AppCompatActivity
import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.*

import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp
import com.alibaba.android.arouter.facade.annotation.Route
import config.TEST_COMPONENT


/**
 * @author: user
 * @date: 2023/2/1
 */
@Route(path = TEST_COMPONENT)
class ComponentLearnActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContent {

            MessageCard("Android")
        }
    }

    @Composable
    fun MessageCard(name: String) {

        Row {
            Image(
                painter = painterResource(id = R.drawable.cns_logo),
                contentDescription = "1111",
                modifier = Modifier
                    .size(48.dp)
                    .clip(CircleShape)

            )
            Spacer(modifier = Modifier.width(8.dp))
            Column {
                Text(text = "Hello $name!")
                Text(text = "Hello $name!")
            }
        }


    }




}